<?php $form=$this->beginWidget('CActiveForm', array(
    	'id'=>'edit-customer-form',
    	'enableAjaxValidation'=>false,
    ));
    
    echo $form->hiddenField($modelUpdate, 'id');
?>
<input type="hidden" id="hi-act-edit-customer-form" name="hi-act-edit-customer-form" value="edit" />
<div class="sub-title">Chỉnh sửa</div>
<div class="sub-content">
	<div class="style-form">
        <dl>
            <dt>Tên khách hàng:</dt>
            <dd><?php echo $form->textField($modelUpdate,'name'); ?></dd>
            <dd><?php echo $form->error($modelUpdate,'name'); ?></dd>
        </dl>
        <dl>
            <dt>Địa chỉ:</dt>
            <dd><?php echo $form->textField($modelUpdate,'adress'); ?></dd>
            <dd><?php echo $form->error($modelUpdate,'adress'); ?></dd>                     
        </dl>
        <dl>
            <dt>Số điện thoại:</dt>
            <dd><?php echo $form->textField($modelUpdate,'phone'); ?></dd>      
            <dd><?php echo $form->error($modelUpdate,'phone'); ?></dd>               
        </dl>
        <dl>
            <dt>Ngày sinh:</dt>
            <dd>
            <?php $this->widget('zii.widgets.jui.CJuiDatePicker', array(
                    'attribute'=>'birthday',
                    'model'=>$modelUpdate,
                    'options'=>array('dateFormat'=>'dd/mm/yy'),
                ));?>
            </dd> 
            <dd><?php echo $form->error($modelUpdate,'birthday'); ?></dd>                    
        </dl>
        <dl>
            <dt></dt>
            <dd>
                <div class="button" style="padding-top:20px; margin-left:80px; clear:both"><a href="#" onclick="$('#edit-customer-form').submit();return false;">Chỉnh sửa</a></div>
            </dd>                  
        </dl>
    </div>
</div>
<?php $this->endWidget(); ?>
<script type="text/javascript">
    $(document).ready(function(){
        submitAjaxForm('edit-customer-form');
    });
    function submitAjaxForm(form)
    {
        $('#'+form).ajaxForm(function(response){
            alert('Thực hiện thành công');
            $('#tr_customer_'+$('#hi-select-customer').val()).html(response);
        });
    }
</script>